
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" />
    <title>城事社</title>
    <meta name="keywords" content="城事社" />
    <meta name="description" content="城事社" />

    <link rel="stylesheet" type="text/css" href="__ROOT__/static/fer/css/comm.css?adf" />
    <script type="text/javascript" src="__ROOT__/static/fer/lib/jquery-1.10.2.js?asdf"></script>

</head>
<body>

<div class="wrap ln_01" style="background:url('__ROOT__/static/fer/upimg/ln_01.jpg') center bottom no-repeat;background-size:cover;">

</div>

<div class="ln_02">
    <div class="ln_02_c">
        <h1><span>后台登录</span><i></i></h1>
        <form class="ajax_form">
            <p><input type="text" name="username" value="" placeholder="请输入账号" class="ln_02_txt" /></p>
            <p><input type="password" name="password" value="" placeholder="请输入密码" class="ln_02_txt" /></p>
        </form>
        <p class="p1"><input type="button" value="登录" class="ln_02_btn ajax_submit"/></p>
    </div>
    <div class="ln_02_b"><img src="__ROOT__/static/fer/upimg/ln_02.jpg" /></div>
</div>

<div class="wrap ln_03">
    <div class="wrap_c">
        <p>Copyright © 2019-2023 城事社 All rights reserved.   V1.0</p>
    </div>
</div>


<script type="text/javascript" data-main="__ROOT__/static/fer/main" src="__ROOT__/static/fer/require.js" defer async="true"></script>
<script type="text/javascript" src="__ROOT__/static/fer/layui/layui.all.js"></script>
<script type="text/javascript">
    var pages = "index";

    $(function(){
        var layer = layui.layer,form = layui.form;
        $(".ajax_submit").click(function(){
            var url = $('.ajax_form').attr("action")?$('.ajax_form').attr("action"):"{:url()}";
            var data = $('.ajax_form').serialize();
            ajax_psot(url,data);

        })
    })

    function ajax_psot(url,data){
        $.ajax({
            url:url,
            type: "POST",//方法类型
            // dataType: "json",//预期服务器返回的数据类型
            data: data,
            success: function (data) {
                if (data.code === 1) {
                    layer.msg("<span style='margin-left: 18px;'>"+data.msg+"</span>",{icon: 1,time:1000},function(){
                        window.location.href=data.url;
                    });
                }else{
                    layer.msg("<span style='margin-left: 18px;'>"+data.msg+"</span>",{icon: 2,time:1000},function(){
                        /*if(data.url){
                            window.location.href=data.url;
                        }else{
                            location.reload();
                        }*/
                    });
                }
            },
            error : function() {
                layer.msg("<span style='margin-left: 18px;'>请求错误,请联系管理员</span>",{icon: 0,time:1000},function(){
                    //location.reload();
                });
            }
        });
    }
</script>
</body>
</html>
